﻿#define _CRT_SECURE_NO_WARNINGS//根据输入的日期，计算是这一年的第几天。 
#include<stdio.h>
int main()
{
	int year = 0;
	int month = 0;
	int day = 0;
	int days = 0;
	int dayss[12] = { 31,0,31,30,31,30,31,31,30,31,30,31 };
	scanf("%d %d %d", &year, &month, &day);

	if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)
		dayss[1] = 29;
	else
		dayss[1] = 28;
	for (int i = 0; i < month - 1; i++)
	{
		days += dayss[i];
	}
	days += day;
	printf("%d", days);


	return 0;
}